<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.7.1.js"></script>
</head>
<body>
    <h1>欢迎<span id="user"></span></h1>
<script>
    var userName = localStorage.getItem("userName");
    $("#user").text(userName);
</script>
</body>
</html>